package main

import (
	"flag"
	"log"
	"net/http"
	"restmail/mail"
	"restmail/rest"
	"strconv"
)

var port uint

func init()  {
	flag.UintVar(&port, "port" , 8080, "-port 8080")
}

func main()  {
	flag.Parse()
	api := rest.CreatRest()
	go mail.GoSend()
	log.Fatal(http.ListenAndServe(":"+ strconv.FormatUint(uint64(port),10), api.MakeHandler()))
}
